package com.boot.repository;

import com.boot.entity.TimeAndPlace;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;


import javax.persistence.criteria.CriteriaBuilder;
import javax.transaction.Transactional;
import java.util.List;

@Transactional
@Repository
public interface TimeAndPlaceRepository extends JpaRepository<TimeAndPlace, Integer>, JpaSpecificationExecutor<TimeAndPlace> {
  List<TimeAndPlace> findAllByWeekdayAndClassroom(Integer weekday, String classroom);
  List<TimeAndPlace> findAllByWeekdayAndAndCourseSerialNumber(Integer weekday,Integer courseSerialNum);
  List<TimeAndPlace> findAllByBuildingAndClassroom(String s1,String s2);
  List<TimeAndPlace> findAllByCourseSerialNumber(Integer integer);
  void deleteAllByCourseSerialNumber(Integer courseSerialNum);
  Boolean existsByCourseSerialNumber(Integer courseSN);

  TimeAndPlace findByCourseSerialNumber(Integer integer);


}
